package com.com.knowledgepaymentmanagementsystem.service.course.impl;

import com.com.knowledgepaymentmanagementsystem.mapper.course.LiveMapper;
import com.com.knowledgepaymentmanagementsystem.pojo.course.Live;
import com.com.knowledgepaymentmanagementsystem.service.course.LiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 张攀
 * @version 1.0
 * @description: TODO
 * @date 2025/9/22 上午11:43
 */
@Service
public class LiveServiceImpl implements LiveService {

    @Autowired
    private LiveMapper liveMapper;
    @Override
    public List<Live> getLive(Live live) {
        return liveMapper.getLive(live);
    }

    @Override
    public String insertLives(Live live) {
        live.setCreateTime(LocalDateTime.now());
        return liveMapper.insertLive(live);
    }

    @Override
    public void updateLives(Live live) {
        liveMapper.updateById(live);
    }

    @Override
    public void deleteLives(Integer id) {
        liveMapper.deleteById(id);
    }
}
